package com.example.big_data.controller;

import com.example.big_data.bean.Product1;
import com.example.big_data.bean.Product2;
import com.example.big_data.bean.Sell;
import com.example.big_data.service.ISearchAllData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

@RestController
public class DataController {

    @Autowired
    ISearchAllData iSearchAllData;

    @GetMapping("product1")
    public List<Product1> SearchAllProduct1() throws IOException {
      return iSearchAllData.SearchAllProduct1();
    }


    @GetMapping("product2")
    public List<Product2> SearchAllProduct2() throws IOException {
        return iSearchAllData.SearchAllProduct2();
    }

    @GetMapping("sell")
    public List<Sell> SearchAllSell() throws IOException {
        return iSearchAllData.SearchAllSell();
    }

}
